home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10039 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  58 lines

  1. Path: solon.com!not-for-mail
  2. From: proctor@corp.hp.com (Stephen Proctor)
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
  4. Subject: C coding problem
  5. Date: 14 Mar 1996 21:14:55 -0600
  6. Organization: Corporate News Server
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4ianbf$h86@solutions.solon.com>
  10. NNTP-Posting-Host: solutions.solon.com
  11. X-Newsreader: TIN [version 1.2 PL2]
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14. Greetings,
  15.  
  16. I am trying to write a *simple* C program and am running into the following
  17. warning problem shown below.  Why do I get this warning?  
  18.  
  19. It seems to have an effect on the logic of the program when executed.
  20.  
  21. I am try to examine the first character in a command line argument, argv[],
  22. to the program for the presence of a "-" sign to identify the argument as
  23. an option.
  24.  
  25. Thanks for any help that can be sent my way.
  26.  
  27. Regards, Steve
  28.  
  29. Note: c89 is the HP-UX POSIX-conformant C compiler
  30.  
  31. Where can a list of warning and error codes be found for this compiler?
  32.  
  33. 1.) The following is the compilation line and the resulting warning message,
  34.  
  35. % c89 shell.c -o shell
  36. cc: "shell.c", line 98: warning 608: Illegal integer-pointer 
  37. combination in assignment.
  38.  
  39. 2.) The program is as follows,
  40.  
  41. #include <stdio.h>
  42. #include <ctype.h>
  43. #include <string.h>
  44. #include <stdlib.h>
  45.  
  46. main(int argc, char *argv[])
  47. {
  48. int ii;
  49. int option_val = 0;
  50. /* skip lines */
  51. for (ii=1; ii<argc; ii++) {
  52. /* skip lines */
  53. /* The next line is the offending line */
  54.    if (*argv[ii] == '-') option_val = read_options;
  55. /* skip lines */
  56. return 0;         /* Program executed successfully */
  57. }
  58.